﻿{extend name="$_tpl_public_layout_ace"/}


{block name="breadcrumb"}
<ul class="breadcrumb">
	<li><i class="fa fa-home home-icon"></i><a href="{:url('manage/index/index')}">{:config('web_site_title')}</a></li>
	<li><a href="{:url('seatsel/manage/index')}">{:config('proj_name')}</a></li>
	<li><a href="{:url('seatsel_manage/order/index')}">{$sideName}</a></li>
</ul>
{/block}


{block name="pageheader"}
<h1>
	{$sideName}
</h1>
{/block}


{block name="content"}
<link rel="stylesheet" href="/tplnew/public/com_order/order_index.css">

<!-- 搜索框 -->
<form method="get" action="" class="form-inline mb20 J_ajaxForm">
	<div class="mb10">
		<div class="form-group">
			<label>交易状态：</label>
			<select name="trade_status" class="form-control">
				<option value="0">全部</option>
				{volist name="trade_status_config" id="vo"}
					<?php
						$selected = $trade_status == $key ? 'selected' : '';
					?>
					<option value="{$key}" {$selected}>{$vo}</option>
				{/volist}
			</select>
		</div>
		<div class="form-group">
			<label>支付状态：</label>
			<select name="pay_status" class="form-control">
				<option value="0">全部</option>
				{volist name="pay_status_config" id="vo"}
					<?php
						$selected = $pay_status == $key ? 'selected' : '';
					?>
					<option value="{$key}" {$selected}>{$vo}</option>
				{/volist}
			</select>
		</div>
		<div class="form-group">
			<label>退款状态：</label>
			<select name="refund_status" class="form-control">
				<option value="0">全部</option>
				{volist name="refund_status_config" id="vo"}
					<?php
						$selected = $refund_status == $key ? 'selected' : '';
					?>
					<option value="{$key}" {$selected}>{$vo}</option>
				{/volist}
			</select>
		</div>
	</div>
	<div class="mb10">
		<div class="form-group">
			<label>订单ID：</label>
			<input type="text" name="id" value="{$id}" class="form-control zz-length2" />
		</div>
		<div class="form-group">
			<label>演出ID：</label>
			<input type="text" name="pid" value="{$pid}" class="form-control zz-length2" />
		</div>
		<div class="form-group">
			<label>演出名称：</label>
			<input type="text" name="product_name" value="{$product_name}" class="form-control zz-length4" />
		</div>
	</div>
	<div class="mb10">
		<div class="form-group">
			<label>订单号：</label>
			<input type="text" name="order_no" value="{$order_no}" class="form-control zz-length4" />
		</div>
		<div class="form-group">
			<label>支付流水号：</label>
			<input type="text" name="payment_trade_no" value="{$payment_trade_no}" class="form-control zz-length4" />
		</div>
	</div>
	<div class="mb10">
		<div class="form-group">
			<label>用户uid：</label>
			<input type="text" name="uid" value="{$uid}" class="form-control zz-length2" />
		</div>
		<div class="form-group">
			<label>论坛uid：</label>
			<input type="text" name="pwuid" value="{$pwuid}" class="form-control zz-length2" />
		</div>
		<div class="form-group">
			<label>用户名：</label>
			<input type="text" name="username" value="{$username}" class="form-control zz-length3" />
		</div>
		<div class="form-group">
			<label>姓名：</label>
			<input type="text" name="realname" value="{$realname}" class="form-control zz-length3" />
		</div>
		<div class="form-group">
			<label>电话：</label>
			<input type="text" name="mobile" value="{$mobile}" class="form-control zz-length3" />
		</div>
	</div>
	<div class="mb10">
		<div class="form-group">
			<label>总额：</label>
			<input type="text" name="total_fee" value="{$total_fee}" class="form-control zz-length2" />
		</div>
		<div class="form-group">
			<label>开始时间：</label>
			<input type="text" name="start_time" value="{$start_time}" class="form-control zz-length3 J_datetimepicker" />
		</div>
		<div class="form-group">
			<label>结束时间：</label>
			<input type="text" name="end_time" value="{$end_time}" class="form-control zz-length3 J_datetimepicker" />
		</div>
	</div>
	<button type="submit" data-action="{:url('seatsel_manage/order/index')}" class="btn btn-success btn-sm J_excel">搜索</button>
	<button type="submit" data-action="{:url('seatsel_manage/order/doExcel')}" class="btn btn-danger btn-sm J_excel">导出</button>
</form>
<hr>
<!-- 搜索框 -->

<?php
${'active_'.$trade_status} = 'active';
${'active_refund_'.$refund_status} = 'active';
?>
<ul id="inbox-tabs" class="inbox-tabs nav nav-tabs padding-16 tab-size-bigger tab-space-1 mb20">
	<li class="{$active_0}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>0))}">全部</a>
	</li>
	<li class="{$active_1}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>1))}">待付款</a>
	</li>
	<li class="{$active_2}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>2))}">已支付</a>
	</li>
	<li class="{$active_3}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>3))}">已发货</a>
	</li>
	<li class="{$active_5}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>5))}">已完成</a>
	</li>
	<li class="{$active_6}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>6))}">用户取消</a>
	</li>
	<li class="{$active_7}">
		<a href="{:url('seatsel_manage/order/index', array('trade_status'=>7))}">交易关闭</a>
	</li>
	<li class="{$active_refund_2}">
		<a href="{:url('seatsel_manage/order/index', array('refund_status'=>2))}">申请退款</a>
	</li>
	<li class="{$active_refund_8}">
		<a href="{:url('seatsel_manage/order/index', array('refund_status'=>8))}">退款中</a>
	</li>
	<li class="{$active_refund_9}">
		<a href="{:url('seatsel_manage/order/index', array('refund_status'=>9))}">全额退款</a>
	</li>
</ul>

<div class="callout callout-info">
	筛选总记录：{$count} 场次总记录：{$sumSpecNum} 筛选总金额：{$sumAmount}
</div>

<form>
	<table class="ui-table-order">
		<thead>
			<tr class="widget-list-header">
				<th class="" colspan="2" style="min-width: 494px; max-width: 494px;">商品</th>
				<th class="price-cell" style="min-width: 80px; max-width: 80px;">单价/数量</th>
				<th class="aftermarket-cell" style="min-width: 85px; max-width: 85px;">售后</th>
				<th class="customer-cell" style="min-width: 110px; max-width: 110px;">买家</th>
				<th class="time-cell" style="min-width: 80px; max-width: 80px;">下单时间</th>
				<th class="state-cell" style="min-width: 100px; max-width: 100px;">订单状态</th>
				<th class="pay-price-cell" style="min-width: 120px; max-width: 120px;">实付金额</th>
			</tr>
		</thead>
		{volist name="orderList" id="vo"}
			<tbody class="widget-list-item">
				<tr class="separation-row">
					<td colspan="9"></td>
				</tr>
				<tr class="header-row">
					<td colspan="7">
						<div>订单号: <a href="{:url('seatsel_manage/order/detail', ['orderId'=>$vo['id']])}" target="_blank">{$vo['order_no']}</a></div>
						<div class="clearfix">
							<div style="margin-top: 4px;margin-right: 20px;display:none;" class="pull-left">
								外部订单号: <span class="c-gray"></span>
							</div>
							{if condition="$vo['payment_trade_no']"}
								<div style="margin-top: 4px;" class="pull-left">
									支付流水号: <span class="c-gray">{$vo['payment_trade_no']}</span>
								</div>
							{/if}
						</div>
					</td>
					<td colspan="2" class="text-right">
						<div class="order-opts-container">
							<div class="js-opts">
							<a href="{:url('seatsel_manage/order/detail', ['orderId'=>$vo['id']])}" class="new-window" target="_blank">查看详情</a>
							<a href="javascript:;" class="js-remark" style="display:none;">备注</a>
							<a href="javascript:;" class="js-star" style="display:none;">加星</a>
							-
							<a href="{:url('seatsel_manage/order/doInvalid', array('orderId'=>$vo['id']))}" class="js-star J_layerConfirm" data-tip="确认失效该订单吗？">失效</a>

							</div>
							<div class="js-star-container hide"><div data-reactroot="" class="ui-star"><span title="去星" class="active"></span><span title="一星" class=""></span><span title="二星" class=""></span><span title="三星" class=""></span><span title="四星" class=""></span><span title="五星" class=""></span></div></div>
						</div>
					</td>
				</tr>
				<?php
					$i = 0;
					$rowCount = count($orderProductList[$vo['id']]);
					$productInfo = $productList[$vo['pid']];
					$specInfo = $specList[$vo['spec_id']];
				?>
				{volist name="orderProductList[$vo['id']]" id="vo2"}
				<?php
					//$productInfo = $productList[$vo2['pid']];
				?>
				<tr class="content-row">
					<!-- 商品信息 -->
					<td class="image-cell"><img src="{$productInfo['picurl']}"></td>
					<td class="title-cell">
						<div class="goods-title">
							<a href="{:url('seatsel/product/detail', array('pid'=>$vo2['pid']))}" target="_blank" class="new-window" title="{$productInfo['title']}">{$productInfo['name']}</a>
						</div>
						<div class="goods-sku">
							{$specInfo['name']}
						</div>
						<div class="goods-sku">
							{$vo2['region_name']}{$vo2['pai']}排{$vo2['zuo']}座
						</div>
					</td>
					<td class="price-cell"><p>{$vo2['real_price']}</p></td>
					<!-- 商品信息 -->
					<!-- 订单信息 -->
					{if condition="$i eq 1"}
						<td class="aftermarket-cell" rowspan="{$rowCount}">
							<p class="c-orange-dark">
								{if condition="$vo['refund_status'] eq 8"}
									退款{$vo['refund_fee']}元<br>
									{$vo['refund_reason']}
								{elseif condition="$vo['refund_status'] eq 9" /}
									已全额退款<br>
									<a href="{:url('seatsel_manage/orderRefund/index', array('order_id'=>$vo['id']))}">查看退款记录</a><br>
									{$vo['refund_reason']}
								{/if}
							</p>
						 </td>
						<td class="customer-cell" rowspan="{$rowCount}">
							<p class="user-name">{$vo['username']}</p>
							<p class="user-name">{$vo['realname']}</p>
							<p>来源：{$vo['user_source']}</p>
						</td>
						<td class="time-cell" rowspan="{$rowCount}">
							<div class="td-cont">
								{$vo['create_time_show']}
							</div>
						</td>
						<td class="state-cell" style="padding-left: 5px;padding-right: 5px;" rowspan="{$rowCount}">
							<div class="td-cont">
								<div class="js-order-state">
									<div>{$vo['trade_status_show']}</div>
									{if condition="$vo['del_status'] eq 2"}
										<hr>
										<div>删除状态：{$vo['del_status_show']}</div>
									{/if}

									{if condition="$vo['trade_status'] eq 2"}
										<hr>
										<div>支付时间：{$vo['pay_time_show']}</div>
										<div>
											<a href="{:url('seatsel_manage/order/send', array('orderId'=>$vo['id']))}" class="btn btn-info btn-xs J_layerDialog" data-tip="商品发货">发	货</a>
										</div>
									{/if}

									{if condition="$vo['trade_status'] eq 5"}
										<hr>
										<div>核销方式：{$vo['verfiy_method_show']}</div>
										<div>核销人员：{$vo['verfiy_name']}</div>
									{/if}

									{if condition="$vo['refund_status'] eq 2"}
										<hr>
										申请退款：原因<br>
										{$vo['refund_reason']}
									{elseif condition="$vo['refund_status'] eq 8" /}
										<hr>
										退款{$vo['refund_fee']}元<br>
										{$vo['refund_reason']}
									{elseif condition="$vo['refund_status'] eq 9" /}
										<hr>
										已全额退款<br>
										{$vo['refund_reason']}
									{/if}

								<hr>
								{$vo['forward_status_show']}
								</div>
								<!-- 自提核销 -->
							</div>
						</td>
						<td class="pay-price-cell" rowspan="{$rowCount}">
							<div class="td-cont text-center">
								<div>￥{$vo['total_fee']}</div>
							</div>
						</td>
					{/if}
					<!-- 订单信息 -->
				</tr>
				{/volist}
				{if condition="$vo['leaveword']"}
				<tr class="remark-row buyer-msg">
					<td colspan="9">买家留言： {$vo['leaveword']}</td>
				</tr>
				{/if}
			</tbody>
		{/volist}
	</table>
</form>
<div class="dataTables-pages">{$pageShow}</div>
{/block}


{block name="script"}
<!--时间选择器-->
{include file="./tplnew/public/script_datetimepicker.html" /}
{/block}